home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 3 / Amiga Format CD03 (1996-07-04)(Future Publishing)(GB)(Track 1 of 6)[!][issue 1996-08].iso / comms / netsoftware / nethandler.lha / NetHandler / proto.h < prev    next >
C/C++ Source or Header  |  1989-09-16  |  3KB  |  96 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2. /* |_o_o|\\ Copyright (c) 1987, 1988 The Software Distillery.  All Rights  */
  3. /* |. o.| || Reserved.  This program may not be distributed without the    */
  4. /* | .  | || permission of the authors:                            BBS:    */
  5. /* | o  | ||   John Toebes     Doug Walker    Dave Baker                   */
  6. /* |  . |//                                                                */
  7. /* ======                                                                  */
  8. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  9.  
  10. #ifdef NETCOMMON
  11. #define GLOBAL NGLOBAL
  12. #endif
  13.  
  14. void cprwait    U_ARGS((GLOBAL));
  15.  
  16. #if PARANOID
  17. extern int paranoid;
  18. #define BUGP(x) if(paranoid) paranoid=request(global, REQ_GENERAL, x);
  19. #else
  20. #define BUGP(x)
  21. #endif
  22.  
  23. #if CPR
  24. /* Debugging routines */
  25. void myputbstr  U_ARGS((char *, ...));
  26. void myputlstr  U_ARGS((char *, ...));
  27. void myprintf   U_ARGS((char *, ...));
  28. void xwrite     U_ARGS((char *, int));
  29. void xgetcr     U_ARGS((void));
  30. int sprintf     U_ARGS((char *, char *, ...));
  31. void mydump     U_ARGS((char *, int));
  32. BPTR initdebug  U_ARGS((BPTR));
  33. void termdebug  U_ARGS((void));
  34.  
  35. #if DEBUG
  36. #define BUG(a) myprintf a;
  37. #define BUGBSTR(a,b) myputbstr(a,b);
  38. #define BUGLSTR(a,b,c) myputlstr(a,b,c);
  39. #define BUGGETC xgetcr();
  40. #define BUGTERM() termdebug();
  41. #define BUGR(x) request(global, REQ_GENERAL, x);
  42.  
  43. #else
  44.  
  45. #define BUG(a)
  46. #define BUGBSTR(a,b)
  47. #define BUGLSTR(a,b,c)
  48. #define BUGGETC
  49. #define BUGTERM()
  50. #define BUGR(x)
  51. #endif
  52.  
  53. #else
  54.  
  55. #define BUG(a)
  56. #define BUGBSTR(a,b)
  57. #define BUGLSTR(a,b,c)
  58. #define BUGGETC
  59. #define BUGTERM()
  60. #define BUGR(x)
  61. #endif
  62.  
  63. extern struct DosLibrary *DOSBase;
  64. #define alloc(a,b) DosAllocMem(a,b)
  65. #define free(p) DosFreeMem(p)
  66.  
  67. /* io#?.c */
  68. int PutRPacket  U_ARGS((GLOBAL, APTR));
  69. int GetRPacket   U_ARGS((GLOBAL, APTR));
  70.  
  71. /* Subs.c */
  72. struct DosPacket *taskwait     U_ARGS((GLOBAL));
  73. void retpkt       U_ARGS((GLOBAL, struct DosPacket *));
  74. char *DosAllocMem U_ARGS((GLOBAL, long));
  75. void DosFreeMem   U_ARGS((char *));
  76. long sendpkt U_ARGS((struct MsgPort *, long, long*, long));
  77. LONG checksum U_ARGS((char *, int));
  78. void CheckRP U_ARGS((struct RPacket *));
  79.  
  80. /* pause.c */
  81. int Pause U_ARGS((ULONG));
  82.  
  83. /* net#?.c */
  84. int ReSync         U_ARGS((GLOBAL, APTR));
  85.  
  86. /* timer.c */
  87. int OpenTimer U_ARGS((GLOBAL, struct MsgPort *));
  88. void CloseTimer U_ARGS((GLOBAL));
  89. void PostTimerReq U_ARGS((GLOBAL, int));
  90.  
  91. /* request.c */
  92. int  request         U_ARGS((GLOBAL, int, char *));
  93. #define REQ_MUST    0
  94. #define REQ_ERROR   1
  95. #define REQ_GENERAL 2
  96.